import request from '@/utils/request'

// 获取树状图数据
export const outfitTree = () => {
  return request({
    url: '/business-hall/tree'
  })
}
// 获取员工信息
export const staffInfo = (params) => {
  return request({
    url: '/business-hall/user/page',
    params
  })
}
// 机构详细信息
export const outfitInfo = (id) => {
  return request({
    url: `/business-hall/${id}`
  })
}
// 获取位置
export const outfitPlace = (parentId) => {
  return request({
    url: '/areas/children',
    params: {
      parentId
    }
  })
}

// 点击保存编辑
export const outfitPreList = (data) => {
  return request({
    url: '/business-hall',
    method: 'post',
    data
  })
}

// 获取运费列表
export const freightTab = (id) => {
  return request({
    url: '/carriages',
    params: {
      id
    }
  })
}

// 删除运费模板
export const delFreight = (id) => {
  return request({
    url: `/carriages/${id}`,
    method: 'delete'
  })
}
// 新增运费模板
export const addFreightTab = (data) => {
  return request({
    url: '/carriages',
    method: 'post',
    data
  })
}
// 获取业务范围
export const sphereBusiness = (id, type) => {
  return request({
    url: `/business-hall/scope/${id}/${type}`
  })
}

